﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.SceneManagement;

namespace Unity.Game.ElisAdvance.PassiveScript
{
    public class DummySenceSwitch:MonoBehaviour
    {

        private PassiveObject obj;

        public DummySenceSwitch(PassiveObject active)
        {
            obj = active;
        }

        public void onInit()
        {
        }

        public void onSetState(int state)
        { 
        }

        public void onProc() 
        {

            if (Com.checkObjectTime(obj, "SwitchObjectTime", 0.1f))
            {
                ActiveObject player = ObjectManager.getElis();

                if (Math2.getDistance(player, obj) < 3.0f)
                {

                    SceneSwitchController ssc = new SceneSwitchController("level0");
                    

                    //SceneManager.LoadScene("level0", LoadSceneMode.Single);
                }
                

            }
            
        }

    }
}
